const {Controller}=require("egg")

class ArticleController extends Controller{
    async getArticle(){
        const {ctx}=this
        const result=await ctx.service.article.getArticle()
        if(result.length){
            ctx.body={
              code:"1001",
              msg:'获取文章成功',
              result
            }
          }else{
            ctx.body={
              code:"1002",
              msg:"获取文章失败"
            }
          }
    }
}

module.exports=ArticleController